<template>
  <div>
    <Dog v-for="(obj,index) in list" :key="index" :arr='obj' @xihuan='love'></Dog>
    <p>你喜欢的狗狗如下</p>
    <ul>
      <li v-for="(item,index) in arr" :key="index">{{item}}</li>
    </ul>

  </div>
</template>

<script>
  import Dog from './components/maigou'
  export default {
    components: {
      Dog
    },
    data() {
      return {
        list: [{
            dogImgUrl: "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
            dogName: "博美",
          },
          {
            dogImgUrl: "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
            dogName: "泰迪",
          },
          {
            dogImgUrl: "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
            dogName: "金毛",
          },
          {
            dogImgUrl: "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
            dogName: "哈士奇",
          },
          {
            dogImgUrl: "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
            dogName: "阿拉斯加",
          },
          {
            dogImgUrl: "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
            dogName: "萨摩耶",
          },
        ],
        arr: []
      }
    },
    methods: {
      love(name) {
        this.arr.push(name)
      }
    }
  }
</script>

<style>

</style>